home *** CD-ROM | disk | FTP | other *** search
/ Aminet 44 / Aminet 44 (2001)(GTI - Schatztruhe)[!][Aug 2001].iso / Aminet / dev / gui / gtlayout.lha / Source / LTP_LayoutGroup.c < prev    next >
C/C++ Source or Header  |  1999-01-03  |  18KB  |  735 lines

  1. /*
  2. **    GadTools layout toolkit
  3. **
  4. **    Copyright © 1993-1999 by Olaf `Olsen' Barthel
  5. **        Freely distributable.
  6. **
  7. **    :ts=4
  8. */
  9.  
  10. #ifndef _GTLAYOUT_GLOBAL_H
  11. #include "gtlayout_global.h"
  12. #endif
  13.  
  14. #include "Assert.h"
  15.  
  16. VOID
  17. LTP_LayoutGroup(LayoutHandle *Handle,ObjectNode *Group)
  18. {
  19.     if(!Handle->Failed)
  20.     {
  21.         ObjectNode    *Node;
  22.         ObjectNode    *ReturnKey;
  23.         ObjectNode    *EscKey;
  24.         ObjectNode    *CursorKey;
  25.         ObjectNode    *TabKey;
  26.         ObjectNode    *ActiveString;
  27.         LONG         Left;
  28.         LONG         Top;
  29.         LONG         Width;
  30.         LONG         Height;
  31.         LONG         MaxWidth;
  32.         LONG         MaxHeight;
  33.         BOOL         DefaultCorrection;
  34.  
  35.         Left                = 0;
  36.         Top                    = 0;
  37.  
  38.         ReturnKey            = NULL;
  39.         EscKey                = NULL;
  40.         CursorKey            = NULL;
  41.         TabKey                = NULL;
  42.         ActiveString        = NULL;
  43.         DefaultCorrection    = FALSE;
  44.         MaxWidth            = 0;
  45.         MaxHeight            = 0;
  46.  
  47.         SCANGROUP(Group,Node)
  48.         {
  49.             LTP_DetermineSize(Handle,Node);
  50.  
  51.             switch(Node->Type)
  52.             {
  53.                 case BUTTON_KIND:
  54.  
  55.                     if(Node->Special.Button.ReturnKey)
  56.                         ReturnKey = Node;
  57.                     else
  58.                     {
  59.                         if(Node->Special.Button.EscKey)
  60.                             EscKey = Node;
  61.                     }
  62.  
  63.                     DefaultCorrection |= Node->Special.Button.DefaultCorrection;
  64.  
  65.                     break;
  66.  
  67.                 case CYCLE_KIND:
  68.  
  69.                     if(Node->Special.Cycle.TabKey)
  70.                         TabKey = Node;
  71.  
  72.                     break;
  73.  
  74.                 #ifdef DO_POPUP_KIND
  75.                 {
  76.                     case POPUP_KIND:
  77.  
  78.                         if(Node->Special.Popup.TabKey)
  79.                             TabKey = Node;
  80.  
  81.                         break;
  82.                 }
  83.                 #endif
  84.  
  85.                 #ifdef DO_TAB_KIND
  86.                 {
  87.                     case TAB_KIND:
  88.  
  89.                         if(Node->Special.Tab.TabKey)
  90.                             TabKey = Node;
  91.  
  92.                         break;
  93.                 }
  94.                 #endif
  95.  
  96.                 case MX_KIND:
  97.  
  98.                     if(Node->Special.Radio.TabKey)
  99.                         TabKey = Node;
  100.  
  101.                     break;
  102.  
  103.                 case PASSWORD_KIND:
  104.                 case STRING_KIND:
  105.                 case FRACTION_KIND:
  106.  
  107.                     if(Node->Special.String.Activate)
  108.                         ActiveString = Node;
  109.  
  110.                     break;
  111.  
  112.                 case INTEGER_KIND:
  113.  
  114.                     if(Node->Special.Integer.Activate)
  115.                         ActiveString = Node;
  116.  
  117.                     break;
  118.  
  119.                 case LISTVIEW_KIND:
  120.  
  121.                     if(Node->Special.List.CursorKey)
  122.                         CursorKey = Node;
  123.  
  124.                     break;
  125.  
  126.                 #ifdef DO_TEXTEDIT_KIND
  127.                 {
  128.                     case TEXTEDIT_KIND:
  129.  
  130.                         if(Node->Special.TextEdit.Activate)
  131.                             ActiveString = Node;
  132.  
  133.                         break;
  134.                 }
  135.                 #endif /* DO_TEXTEDIT_KIND */
  136.             }
  137.  
  138.             if(Node->Width > MaxWidth)
  139.                 MaxWidth = Node->Width;
  140.  
  141.             if(Node->Height > MaxHeight)
  142.                 MaxHeight = Node->Height;
  143.         }
  144.  
  145.         if(ReturnKey || DefaultCorrection)
  146.         {
  147.             SCANGROUP(Group,Node)
  148.             {
  149.                 #ifdef OLD_STYLE_DEFAULT_KEY
  150.                 {
  151.                     Node->GroupIndent = TRUE;
  152.  
  153.                     Node->Width        += 4 + 4;
  154.                     Node->Height    += 2 + 2;
  155.                 }
  156.                 #else
  157.                 {
  158.                     Node->Width        += 1 + 1;
  159.                     Node->Height    += 1 + 1;
  160.                 }
  161.                 #endif
  162.  
  163.                 if(Node->Width > MaxWidth)
  164.                     MaxWidth = Node->Width;
  165.  
  166.                 if(Node->Height > MaxHeight)
  167.                     MaxHeight = Node->Height;
  168.             }
  169.         }
  170.  
  171.         if(Group->Special.Group.SameSize)
  172.         {
  173.             SCANGROUP(Group,Node)
  174.             {
  175.                 if(Node->Width < MaxWidth && Node->Type != YBAR_KIND && Node->Type != CHECKBOX_KIND)
  176.                 {
  177.                     if(Node->Type == GROUP_KIND)
  178.                     {
  179.                         if(!Node->Special.Group.NoIndent)
  180.                         {
  181.                             if(Node->Special.Group.AlignRight)
  182.                                 Node->Special.Group.ExtraLeft += MaxWidth - Node->Width;
  183.                             else
  184.                                 Node->Special.Group.ExtraLeft += (MaxWidth - Node->Width) / 2;
  185.                         }
  186.                     }
  187.  
  188.                     Node->Width = MaxWidth;
  189.                 }
  190.  
  191.                 if(Node->Height < MaxHeight && Node->Type != XBAR_KIND && Node->Type != CHECKBOX_KIND)
  192.                 {
  193.                     if(Node->Type == GROUP_KIND && !Node->Special.Group.NoIndent)
  194.                         Node->Special.Group.ExtraTop += (MaxHeight - Node->Height) / 2;
  195.  
  196.                     Node->Height = MaxHeight;
  197.                 }
  198.             }
  199.         }
  200.  
  201.         if(Group->Special.Group.Horizontal)
  202.         {
  203.             LONG x,y,w,MaxTop = 0,MaxWidth = 0,MaxHeight = 0,Count = 0;
  204.  
  205.             if(Group->Node.mln_Pred->mln_Pred && Group->Special.Group.LastAttributes)
  206.             {
  207.                 ObjectNode *LastGroup = (ObjectNode *)Group->Node.mln_Pred;
  208.  
  209.                 MaxTop        = LastGroup->Special.Group.MaxOffset;
  210.                 MaxHeight    = LastGroup->Special.Group.MaxSize;
  211.             }
  212.  
  213.             SCANGROUP(Group,Node)
  214.             {
  215.                 if(!LIKE_STRING_KIND(Node) || Node->Special.String.LinkID == -1)
  216.                 {
  217.                     if(!Group->Special.Group.Paging && Count++)
  218.                     {
  219.                         if(Node->ExtraSpace > 0)
  220.                             x = Left + Node->ExtraSpace * Handle->InterWidth;
  221.                         else
  222.                         {
  223.                             if(Node->ExtraSpace < 0)
  224.                                 x = Left - Node->ExtraSpace;
  225.                             else
  226.                                 x = Left + Node->LayoutSpace * Handle->InterWidth;
  227.                         }
  228.                     }
  229.                     else
  230.                         x = Left;
  231.  
  232.                     y = Top;
  233.                     w = Node->Width;
  234.  
  235.                     switch(Node->LabelPlace)
  236.                     {
  237.                         case PLACE_LEFT:
  238.  
  239.                             if(Node->Type == MX_KIND)
  240.                             {
  241.                                 x += Node->Special.Radio.LabelWidth + INTERWIDTH;
  242.  
  243.                                 if(Node->Label)
  244.                                 {
  245.                                     if(Node->Special.Radio.TitlePlace == PLACETEXT_LEFT)
  246.                                         x += Node->LabelWidth + INTERWIDTH;
  247.                                     else
  248.                                         w += INTERWIDTH + Node->LabelWidth;
  249.                                 }
  250.                             }
  251.                             else
  252.                             {
  253.                                 if(Node->Label || (Node->Type == BOX_KIND && Node->Special.Box.Labels))
  254.                                     x += Node->LabelWidth + INTERWIDTH;
  255.                             }
  256.  
  257.                             break;
  258.  
  259.                         case PLACE_RIGHT:
  260.  
  261.                             if(Node->Type == MX_KIND)
  262.                             {
  263.                                 w += INTERWIDTH + Node->Special.Radio.LabelWidth;
  264.  
  265.                                 if(Node->Label)
  266.                                 {
  267.                                     if(Node->Special.Radio.TitlePlace == PLACETEXT_LEFT)
  268.                                         x += Node->LabelWidth + INTERWIDTH;
  269.                                     else
  270.                                         w += INTERWIDTH + Node->LabelWidth;
  271.                                 }
  272.                             }
  273.                             else
  274.                             {
  275.                                 if(Node->Label || (Node->Type == BOX_KIND && Node->Special.Box.Labels))
  276.                                     w += INTERWIDTH + Node->LabelWidth;
  277.                             }
  278.  
  279.                             break;
  280.  
  281.                         case PLACE_ABOVE:
  282.  
  283.                             if(Node->Label || (Node->Type == BOX_KIND && Node->Special.Box.Labels))
  284.                             {
  285.                                 if(Node->Type == LISTVIEW_KIND && Node->Special.List.TextAttr && Node->Special.List.FlushLabelLeft)
  286.                                     y += Node->Special.List.FixedGlyphHeight + INTERHEIGHT;
  287.                                 else
  288.                                     y += Handle->GlyphHeight + INTERHEIGHT;
  289.                             }
  290.  
  291.                             break;
  292.                     }
  293.  
  294.                     if(Node->Type == SLIDER_KIND)
  295.                     {
  296.                         if(Node->Special.Slider.LevelPlace == PLACETEXT_RIGHT && Node->Special.Slider.LevelFormat)
  297.                             w += INTERWIDTH + Node->Special.Slider.LevelWidth;
  298.  
  299.                         if(Node->Special.Slider.LevelPlace == PLACETEXT_LEFT && Node->LabelPlace != PLACE_LEFT && Node->Special.Slider.LevelFormat)
  300.                             x += INTERWIDTH + Node->Special.Slider.LevelWidth;
  301.                     }
  302.  
  303.                     #ifdef DO_LEVEL_KIND
  304.                     {
  305.                         if(Node->Type == LEVEL_KIND)
  306.                         {
  307.                             if(Node->Special.Level.LevelFormat != NULL)
  308.                             {
  309.                                 if(Node->Special.Level.LevelPlace == PLACETEXT_RIGHT)
  310.                                     w += INTERWIDTH + Node->Special.Level.MaxLevelWidth;
  311.  
  312.                                 if(Node->Special.Level.LevelPlace == PLACETEXT_LEFT && Node->LabelPlace != PLACE_LEFT)
  313.                                     x += INTERWIDTH + Node->Special.Level.MaxLevelWidth;
  314.                             }
  315.                         }
  316.                     }
  317.                     #endif    /* DO_LEVEL_KIND */
  318.  
  319.                     if(Node->Type == LISTVIEW_KIND && Node->Special.List.ExtraLabelWidth)
  320.                         x += Node->Special.List.ExtraLabelWidth + INTERWIDTH;
  321.  
  322.                     if(y > MaxTop)
  323.                         MaxTop = y;
  324.  
  325.                     if(Node->Height > MaxHeight)
  326.                         MaxHeight = Node->Height;
  327.  
  328.                     if(Node->LabelPlace == PLACE_BELOW && Node->Label)
  329.                     {
  330.                         LONG Height;
  331.  
  332.                         if(Node->Type == LISTVIEW_KIND && Node->Special.List.TextAttr && Node->Special.List.FlushLabelLeft)
  333.                             Height = Node->Height + INTERHEIGHT + Node->Special.List.FixedGlyphHeight;
  334.                         else
  335.                             Height = Node->Height + INTERHEIGHT + Handle->GlyphHeight;
  336.  
  337.                         if(Height > MaxHeight)
  338.                             MaxHeight = Height;
  339.                     }
  340.                     else
  341.                     {
  342.                         if(Node->Height > MaxHeight)
  343.                             MaxHeight = Node->Height;
  344.                     }
  345.  
  346.                     if(x + w > MaxWidth)
  347.                         MaxWidth = x+w;
  348.  
  349.                     Node->Left = x;
  350.  
  351.                     if(!Group->Special.Group.Paging)
  352.                         Left = x + w;
  353.                 }
  354.             }
  355.  
  356.             SCANGROUP(Group,Node)
  357.             {
  358.                 if(!LIKE_STRING_KIND(Node) || Node->Special.String.LinkID == -1)
  359.                 {
  360.                     Node->Top = MaxTop;
  361.  
  362.                     if(Node->Type == GROUP_KIND)
  363.                         Node->Special.Group.ExtraTop += MaxTop - Top;
  364.  
  365.                     if(Node->Height < MaxHeight)
  366.                     {
  367.                         register BOOL CanChangeHeight;
  368.  
  369.                         #ifdef DO_BOOPSI_KIND
  370.                         {
  371.                             CanChangeHeight = (BOOL)(    (Node->Type == PALETTE_KIND && !Node->Special.Palette.UsePicker) ||
  372.                                                         (Node->Type == LISTVIEW_KIND) ||
  373.                                                         (Node->Type == BOOPSI_KIND && !Node->Special.BOOPSI.ExactHeight)
  374.                                                     );
  375.                         }
  376.                         #else
  377.                         {
  378.                             CanChangeHeight = (BOOL)(    (Node->Type == PALETTE_KIND && !Node->Special.Palette.UsePicker) ||
  379.                                                         (Node->Type == LISTVIEW_KIND)
  380.                                                     );
  381.                         }
  382.                         #endif    /* DO_BOOPSI_KIND */
  383.  
  384.                         if(CanChangeHeight)
  385.                         {
  386.                             Node->Height = MaxHeight;
  387.                         }
  388.                         else
  389.                         {
  390.                             if(Node->Type == GROUP_KIND)
  391.                             {
  392.                                 if(Node->Special.Group.Spread)
  393.                                 {
  394.                                     LTP_Spread(Handle,Node,Node->Width,MaxHeight);
  395.                                 }
  396.                                 else
  397.                                 {
  398.                                     if(!Node->Special.Group.NoIndent)
  399.                                         Node->Special.Group.ExtraTop += (MaxHeight - Node->Height) / 2; /* !FIX! */
  400.                                 }
  401.  
  402.                                 Node->Height = MaxHeight;
  403.                             }
  404.                         }
  405.                     }
  406.                 }
  407.             }
  408.  
  409.             Group->Special.Group.MaxOffset = MaxTop;
  410.             Group->Special.Group.MaxSize   = MaxHeight;
  411.  
  412.             if(Group->Special.Group.Paging)
  413.                 Width = MaxWidth;
  414.             else
  415.                 Width = Left;
  416.  
  417.             Height = MaxTop + MaxHeight;
  418.         }
  419.         else
  420.         {
  421.             LONG x,y,w,MaxLeft = 0,MaxWidth = 0,MaxHeight = 0,Count = 0;
  422.  
  423.             if(Group->Node.mln_Pred->mln_Pred && Group->Special.Group.LastAttributes)
  424.             {
  425.                 ObjectNode *LastGroup = (ObjectNode *)Group->Node.mln_Pred;
  426.  
  427.                 MaxLeft     = LastGroup->Special.Group.MaxOffset;
  428.                 MaxWidth    = LastGroup->Special.Group.MaxSize;
  429.             }
  430.  
  431.             SCANGROUP(Group,Node)
  432.             {
  433.                 if(!LIKE_STRING_KIND(Node) || Node->Special.String.LinkID == -1)
  434.                 {
  435.                     if(!Group->Special.Group.Paging && Count++)
  436.                     {
  437.                         if(Node->ExtraSpace > 0)
  438.                             y = Top + Node->ExtraSpace * Handle->InterHeight;
  439.                         else
  440.                         {
  441.                             if(Node->ExtraSpace < 0)
  442.                                 y = Top - Node->ExtraSpace;
  443.                             else
  444.                                 y = Top + Node->LayoutSpace * Handle->InterHeight;
  445.                         }
  446.                     }
  447.                     else
  448.                         y = Top;
  449.  
  450.                     w = Node->Width;
  451.                     x = Left;
  452.  
  453.                     switch(Node->LabelPlace)
  454.                     {
  455.                         case PLACE_LEFT:
  456.  
  457.                             if(Node->Type == MX_KIND)
  458.                             {
  459.                                 x += Node->Special.Radio.LabelWidth + INTERWIDTH;
  460.  
  461.                                 if(Node->Label)
  462.                                 {
  463.                                     if(Node->Special.Radio.TitlePlace == PLACETEXT_LEFT)
  464.                                         x += Node->LabelWidth + INTERWIDTH;
  465.                                 }
  466.                             }
  467.                             else
  468.                             {
  469.                                 if(Node->Label || (Node->Type == BOX_KIND && Node->Special.Box.Labels))
  470.                                     x += Node->LabelWidth + INTERWIDTH;
  471.                             }
  472.  
  473.                             break;
  474.  
  475.                         case PLACE_RIGHT:
  476.  
  477.                             if(Node->Type == MX_KIND)
  478.                             {
  479.                                 w += INTERWIDTH + Node->Special.Radio.LabelWidth;
  480.  
  481.                                 if(Node->Label)
  482.                                 {
  483.                                     if(Node->Special.Radio.TitlePlace == PLACETEXT_LEFT)
  484.                                         x += Node->LabelWidth + INTERWIDTH;
  485.                                     else
  486.                                         w += INTERWIDTH + Node->LabelWidth;
  487.                                 }
  488.                             }
  489.                             else
  490.                             {
  491.                                 if(Node->Label || (Node->Type == BOX_KIND && Node->Special.Box.Labels))
  492.                                     w += INTERWIDTH + Node->LabelWidth;
  493.                             }
  494.  
  495.                             break;
  496.  
  497.                         case PLACE_ABOVE:
  498.  
  499.                             if(Node->Label || (Node->Type == BOX_KIND && Node->Special.Box.Labels))
  500.                             {
  501.                                 if(Node->Type == LISTVIEW_KIND && Node->Special.List.TextAttr && Node->Special.List.FlushLabelLeft)
  502.                                     y += Node->Special.List.FixedGlyphHeight + INTERHEIGHT;
  503.                                 else
  504.                                     y += Handle->GlyphHeight + INTERHEIGHT;
  505.                             }
  506.  
  507.                             break;
  508.                     }
  509.  
  510.                     if(Node->Type == SLIDER_KIND)
  511.                     {
  512.                         if(Node->Special.Slider.LevelPlace == PLACETEXT_RIGHT && Node->Special.Slider.LevelFormat)
  513.                             w += INTERWIDTH + Node->Special.Slider.LevelWidth;
  514.  
  515.                         if(Node->Special.Slider.LevelPlace == PLACETEXT_LEFT && Node->LabelPlace != PLACE_LEFT && Node->Special.Slider.LevelFormat)
  516.                             x += INTERWIDTH + Node->Special.Slider.LevelWidth;
  517.                     }
  518.  
  519.                     #ifdef DO_LEVEL_KIND
  520.                     {
  521.                         if(Node->Type == LEVEL_KIND)
  522.                         {
  523.                             if(Node->Special.Level.LevelFormat != NULL)
  524.                             {
  525.                                 if(Node->Special.Level.LevelPlace == PLACETEXT_RIGHT)
  526.                                     w += INTERWIDTH + Node->Special.Level.MaxLevelWidth;
  527.  
  528.                                 if(Node->Special.Level.LevelPlace == PLACETEXT_LEFT && Node->LabelPlace != PLACE_LEFT)
  529.                                     x += INTERWIDTH + Node->Special.Level.MaxLevelWidth;
  530.                             }
  531.                         }
  532.                     }
  533.                     #endif    /* DO_LEVEL_KIND */
  534.  
  535.                     if(Node->Type == LISTVIEW_KIND && Node->Special.List.ExtraLabelWidth)
  536.                         x += Node->Special.List.ExtraLabelWidth + INTERWIDTH;
  537.  
  538.                     if(x > MaxLeft)
  539.                         MaxLeft = x;
  540.  
  541.                     if(w > MaxWidth)
  542.                         MaxWidth = w;
  543.  
  544.                     if(y + Node->Height > MaxHeight)
  545.                         MaxHeight = y + Node->Height;
  546.  
  547.                     Node->Top = y;
  548.  
  549.                     if(!Group->Special.Group.Paging)
  550.                         Top = y + Node->Height;
  551.  
  552.                     if(Node->LabelPlace == PLACE_BELOW && Node->Label)
  553.                     {
  554.                         if(Node->Type == LISTVIEW_KIND && Node->Special.List.TextAttr && Node->Special.List.FlushLabelLeft)
  555.                             Top += INTERHEIGHT + Node->Special.List.FixedGlyphHeight;
  556.                         else
  557.                             Top += INTERHEIGHT + Handle->GlyphHeight;
  558.                     }
  559.                 }
  560.             }
  561.  
  562.             SCANGROUP(Group,Node)
  563.             {
  564.                 if(!LIKE_STRING_KIND(Node) || Node->Special.String.LinkID == -1)
  565.                 {
  566.                     Node->Left = MaxLeft;
  567.  
  568.                     if(Node->Type == GROUP_KIND)
  569.                     {
  570.                         if(Group->Special.Group.Paging && !Node->Special.Group.NoIndent)
  571.                             Node->Special.Group.ExtraTop += (MaxHeight - Node->Height) / 2;
  572.  
  573.                         Node->Special.Group.ExtraLeft += MaxLeft - Left;
  574.                     }
  575.  
  576.                     if(Node->Width < MaxWidth)
  577.                     {
  578.                         if(Node->Type == GROUP_KIND)
  579.                         {
  580.                             if(Node->Special.Group.Spread)
  581.                                 LTP_Spread(Handle,Node,MaxWidth,Node->Height);
  582.                             else
  583.                             {
  584.                                 if(!Node->Special.Group.NoIndent)
  585.                                 {
  586.                                     if(Node->Special.Group.AlignRight)
  587.                                         Node->Special.Group.ExtraLeft += MaxWidth - Node->Width;
  588.                                     else
  589.                                         Node->Special.Group.ExtraLeft += (MaxWidth - Node->Width) / 2;
  590.                                 }
  591.                             }
  592.  
  593.                             Node->Width = MaxWidth;
  594.                         }
  595.                         else
  596.                         {
  597.                             register BOOL CanChangeWidth;
  598.  
  599.                             #ifdef DO_BOOPSI_KIND
  600.                             {
  601.                                 CanChangeWidth = (BOOL)(    (Node->Type == LISTVIEW_KIND && !Node->Special.List.LockSize) ||
  602.                                                             (Node->Type == PALETTE_KIND && !Node->Special.Palette.UsePicker) ||
  603.                                                             (Node->Type == TEXT_KIND && !Node->Special.Text.LockSize) ||
  604.                                                             (LIKE_STRING_KIND(Node)) ||
  605.                                                             (Node->Type == BLANK_KIND) ||
  606.                                                             (Node->Type == BOX_KIND) ||
  607.                                                             (Node->Type == BUTTON_KIND) ||
  608.                                                             (Node->Type == CYCLE_KIND) ||
  609.                                                             (Node->Type == GAUGE_KIND) ||
  610.                                                             (Node->Type == INTEGER_KIND) ||
  611.                                                             (Node->Type == NUMBER_KIND) ||
  612.                                                             (Node->Type == SCROLLER_KIND) ||
  613.                                                             (Node->Type == SLIDER_KIND) ||
  614.                                                             (Node->Type == BOOPSI_KIND && !Node->Special.BOOPSI.ExactWidth) ||
  615.                                                             (Node->Type == LEVEL_KIND) ||
  616.                                                             (Node->Type == TEXTEDIT_KIND) ||
  617.                                                             (Node->Type == POPUP_KIND) ||
  618.                                                             (Node->Type == TAB_KIND)
  619.                                                         );
  620.                             }
  621.                             #else
  622.                             {
  623.                                 CanChangeWidth = (BOOL)(    (Node->Type == LISTVIEW_KIND && !Node->Special.List.LockSize) ||
  624.                                                             (Node->Type == PALETTE_KIND && !Node->Special.Palette.UsePicker) ||
  625.                                                             (Node->Type == TEXT_KIND && !Node->Special.Text.LockSize) ||
  626.                                                             (LIKE_STRING_KIND(Node)) ||
  627.                                                             (Node->Type == BLANK_KIND) ||
  628.                                                             (Node->Type == BOX_KIND) ||
  629.                                                             (Node->Type == BUTTON_KIND) ||
  630.                                                             (Node->Type == CYCLE_KIND) ||
  631.                                                             (Node->Type == GAUGE_KIND) ||
  632.                                                             (Node->Type == INTEGER_KIND) ||
  633.                                                             (Node->Type == NUMBER_KIND) ||
  634.                                                             (Node->Type == SCROLLER_KIND) ||
  635.                                                             (Node->Type == SLIDER_KIND)
  636.                                                         );
  637.                             }
  638.                             #endif    /* DO_BOOPSI_KIND */
  639.  
  640.                             if(CanChangeWidth)
  641.                             {
  642.                                 if(Node->Label && Node->LabelPlace == PLACE_RIGHT)
  643.                                     Node->Width = MaxWidth - (INTERWIDTH + Node->LabelWidth);
  644.                                 else
  645.                                     Node->Width = MaxWidth;
  646.                             }
  647.                         }
  648.                     }
  649.                 }
  650.             }
  651.  
  652.             Group->Special.Group.MaxOffset  = MaxLeft;
  653.             Group->Special.Group.MaxSize    = MaxWidth;
  654.  
  655.             if(Group->Special.Group.Paging)
  656.                 Height = MaxHeight;
  657.             else
  658.                 Height = Top;
  659.  
  660.             Width = MaxLeft + MaxWidth;
  661.         }
  662.  
  663.         Group->Left        = 0;
  664.         Group->Top        = 0;
  665.         Group->Width    = Width;
  666.         Group->Height    = Height;
  667.  
  668.         if(Group->Label || Group->Special.Group.Frame || Group->Special.Group.FrameType != FRAMETYPE_None)
  669.         {
  670.             if(Group->Label)
  671.             {
  672.                 Group->LabelWidth = LT_LabelWidth(Handle,Group->Label) + 2 * Handle->GlyphWidth;
  673.  
  674.                 Group->Height += Handle->GlyphHeight + 2 * Handle->InterHeight + 3;
  675.             }
  676.             else
  677.             {
  678.                 Group->LabelWidth = 0;
  679.  
  680.                 Group->Height += 2 + 2 * Handle->InterHeight + 3;
  681.             }
  682.  
  683.             if(Group->LabelWidth > Group->Width)
  684.             {
  685.                 if(!Node->Special.Group.NoIndent)
  686.                 {
  687.                     if(Node->Special.Group.AlignRight)
  688.                         Group->Special.Group.ExtraLeft += Group->LabelWidth - Group->Width;
  689.                     else
  690.                         Group->Special.Group.ExtraLeft += (Group->LabelWidth - Group->Width) / 2;
  691.                 }
  692.  
  693.                 Group->Width = Group->LabelWidth;
  694.             }
  695.             else
  696.             {
  697.                 if(Group->Special.Group.FrameType == FRAMETYPE_Tab)
  698.                 {
  699.                     Group->Special.Group.ExtraLeft += Handle->GlyphWidth;
  700.                     Group->Width += 2 * Handle->GlyphWidth;
  701.                 }
  702.             }
  703.  
  704.             Group->Width += 2 * (Handle->GlyphWidth + Handle->InterWidth) + 8;
  705.         }
  706.  
  707.         if(Group->Special.Group.IndentX)
  708.         {
  709.             Group->Width                    += 2 * Handle->InterWidth;
  710.             Group->Special.Group.ExtraLeft    += Handle->InterWidth;
  711.         }
  712.  
  713.         if(Group->Special.Group.IndentY)
  714.         {
  715.             Group->Height                    += 2 * Handle->InterHeight;
  716.             Group->Special.Group.ExtraTop    += Handle->InterHeight;
  717.         }
  718.  
  719.         if(ReturnKey)
  720.             Handle->ReturnKey = ReturnKey;
  721.  
  722.         if(EscKey)
  723.             Handle->EscKey = EscKey;
  724.  
  725.         if(CursorKey)
  726.             Handle->CursorKey = CursorKey;
  727.  
  728.         if(TabKey)
  729.             Handle->TabKey = TabKey;
  730.  
  731.         if(ActiveString)
  732.             Handle->ActiveString = ActiveString;
  733.     }
  734. }
  735.